package emulator.hardware.io.peripherals.iec;

import java.nio.ByteBuffer;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class IecSimNullPrinter implements IecSimDevice
{
	static Logger logger = LogManager.getLogger(IecSimNullPrinter.class.getName());
	private IecSim iec_sim = null;

	@Override
	public void setIecSim(IecSim iec_sim) {
		this.iec_sim = iec_sim;
	}

	@Override
	public void processCommand(ByteBuffer data) {
		/* NOP */
	}

	@Override
	public void processData(ByteBuffer data) {
		/* NOP */
	}

	@Override
	public void unlisten() {
		/* NOP */
	}

	@Override
	public void listen() {
		logger.entry();
		iec_sim.initReceive(this);
	}

	@Override
	public void talk() {
		logger.warn("Printer can't talk!");
	}

	@Override
	public void untalk() {
		/* NOP */
	}

	@Override
	public int read() {
		logger.warn("Cannot read from printer!");
		return -1;
	}

	@Override
	public void rewind(int offset) {
	}
}
